<template id="app-header">
	<div>
		<v-row class="header-col">
			<v-col span="6" class="logo-col">
				<img class="logo" src="../assets/images/logo.png">
			</v-col>
			<v-col span="12" class="menu-col">
				<v-menu mode="horizontal" :data="menuData" @item-click="clickMenu"></v-menu>
			</v-col>
			<v-col span="6" class="login-col">
				<div class="text-lg login-box">
					<v-icon class="login-cell" type="search"></v-icon>
					<span class="login-cell">登陆</span>
					<span class="login-cell">注册</span>
				</div>
			</v-col>
		</v-row>
		<div class="mobile-header-col">
			<div @click="clickMenuBtn">
				<v-icon type="bars"></v-icon>
			</div>
			<div class="mobile-login-cell">
				<span style="margin-right:10px;">
					<v-icon type="search"></v-icon>
				</span>
				<span>
					<v-icon type="user"></v-icon>
				</span>
			</div>
		</div>
		<div class="mobile-menu-panel" v-show="mobileMenuShow">
			<v-menu class="mobile-menu" :data="menuData" @item-click="clickMenu"></v-menu>
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			menuData: [
				{
		            name: '首页',
					selected: true,
					pathName: '/'
		        },
		        {
					name: '课程',
					pathName: 'lesson'
		        },
		        {
					name: '作品',
					pathName: 'photo'
		        },
		        {
					name: '关于我们',
					pathName: 'about'
		        }
	        ],
			mobileMenuShow: false
		}
	},
	methods: {
		clickMenuBtn() {
			console.log("clickMenuBtn")
			this.mobileMenuShow = !this.mobileMenuShow;
		},

		clickMenu(item) {
			// console.log(item[0].pathName);
			let pathName = item[0].pathName;
			this.$router.push(pathName);
		}
	}
}
</script>

<style>

.header-col {
	height: 86px;
	border-bottom: solid 2px #EFEFEF;
}

.logo-col {
	text-align: center;
	padding: 18px 0;
	
}

.logo {
	width: 250px;
}

.menu-col {
	padding: 20px 0;
}

.ant-menu-horizontal {
	border: none;
	font-size: 20px;
	color: #333333;
}

.ant-menu-horizontal>.ant-menu-item {
	margin: 0;
	padding: 0;
	width: 25%;
	text-align: center;
	border-bottom: none;
}

.ant-menu-horizontal>.ant-menu-item-selected,
.ant-menu-horizontal>.ant-menu-item:hover,
.ant-menu-horizontal>.ant-menu-item-selected:hover {
	border: none;
	color: #2D8B8E;
}

.login-box {
	height: 86px;
	width: 118px;
	display: flex;
	flex-direction: row;
	align-items: center;
	color: #C4A57F;
	margin: 0 auto;
}

.login-box>.login-cell {
	padding: 0 8px;
}

.mobile-header-col {
	display: none;
}

/** 响应式手机端样式布局 */
@media screen and (max-width: 768px) {
	.header-col {
		display: none;
	}
	.mobile-header-col {
		display: block;
		height: 45px;
		width: 100%;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 10px 15px;
		font-size: 25px;
		font-weight: bolder;
		color: #2D8B8E;
	}
	.mobile-menu-panel {
		width: 100%;
		position: absolute;
		top: 45px;
		z-index: 999;
	}

	.mobile-login-cell {
		color: #C4A57F;
		font-weight: normal;
	}

	.ant-menu-vertical .ant-menu-item {
		font-size: 16px;
	}
	.ant-menu-item-selected,
	.ant-menu-item:hover {
		color: #2D8B8E;
	}

}

</style>
